import Vue from 'vue'
import Router from 'vue-router'
import Home from '../views/home.vue'

Vue.use(Router)

const routes= [

  {
    path:'/',
    redirect: '/home'
  },
  {
    path:'/login',
    name:'login',
    component: () => import('@/views/Login.vue')
  },
  {
    path:'/home',
    name:'home',
    meta:{title:'首页'},
    component: () => import('@/views/Home/index.vue'),
    children:[
      {
        path:'/index',
        name:'index',
        meta:{title:'首页'},
        component: () => import('@/views/Home/index/index.vue')
      },
      {
        path:'/stats',
        name:'stats',
        meta:{title:'消费流水'},
        component: () => import('@/views/Home/stats/stats.vue')
      },
      {
        path:'/category',
        name:'category',
        meta:{title:'分类管理'},
        component: () => import('@/views/Home/category/index.vue'),
      },
      {
        path:'/user',
        name:'user',
        meta:{title:'用户管理'},
        component: () => import('@/views/Home/user/index.vue'),
      },
      {
        path:'/chart',
        name:'chart',
        meta:{title:'用户管理'},
        component: () => import('@/views/Home/chart/chart.vue'),
      }


    ]
  }
]

const router = new Router({
  routes
})

export default router
